<template>
  <!-- 已终止 -->
  <div class="box clearfix">
    <section class="section_wrap">
      <FunctionalAreas
        :markUpdate="markUpdate"
        :orderNumber="orderNumber"
      ></FunctionalAreas>
      <div class="title_sub prduct_bod_r">产品说明：</div>
      <ProductDescriptionToo></ProductDescriptionToo>
    </section>
    <section class="section_wrap">
      <div class="title_sub infro_bod_l">信息查看：</div>
      <div class="state" v-if="this.orderStatus == 6">
        <div  >状态：已中止</div>
        <div class="zz-stateDescription">中止原因:{{orderInfo.operationCase}}</div>
      </div>
      <div class="state" v-if="this.orderStatus == 5">状态：已归档</div>
      <InformationsViewer :orderNumber="orderNumber"></InformationsViewer>
    </section>
    <section class="section_wrap" v-if="showFinancialInfo">
      <div class="title_sub infro_bod_l">财务信息:</div>
      <financialInfo :showBtn="showBtn" :orderNumber="orderNumber"></financialInfo>
    </section>
    <section class="section_wrap">
      <div class="title_sub infro_bod_l">风控大数据查询</div>
      <viewInfo> </viewInfo>
    </section>
    <section class="section_wrap" v-if="this.orderStatus == 5">
      <div class="commission" v-if="this.orderStatus == 5">
        <div class="title_sub ingz_bod_l">提成规则：</div>
        <Commission :orderNumber="orderNumber"></Commission>
      </div>
    </section>

    <section class="section_wrap">
      <div class="title_sub upload_bod_l">附件管理：</div>
      <!-- 上传组件 -->
      <Upload class="uploadStyle" :isNew="isNew"></Upload>
    </section>
    <section class="section_wrap">
      <Attachment></Attachment>
      <div class="title_sub appro_bod_r">审批流：</div>
      <ApprovalText :orderNumber="orderNumber"></ApprovalText>
      <div class="title_sub prduct_bod_r">操作记录：</div>
      <OperationRecords :orderNumber="orderNumber"></OperationRecords>
    </section>
  </div>
</template>

<script>
import FunctionalAreas from "../../components/meitList/FunctionalAreas";
import ProductDescriptionToo from "../../components/meitList/ProductDescriptionToo";
import InformationsViewer from "../../components/meitList/EndView";
import ApprovalText from "../../components/meitList/ApprovalText";
import Attachment from "../../components/meitList/Attachment";
import Upload from "../../components/meitList/Upload";
import OperationRecords from "../../components/meitList/OperationRecords";
import Commission from "../../components/meitList/Commission";
import viewInfo from "../../components/business/viweInfo.vue";
import { getProductUrl,getFindOrderMessage } from "@/assets/js/api";
import { checkPermiss } from "../../assets/js/utlis";
import financialInfo from "../../components/business/financialInfo";
export default {
  name: "Terminated",
  components: {
    FunctionalAreas,
    ProductDescriptionToo,
    InformationsViewer,
    ApprovalText,
    Attachment,
    Upload,
    OperationRecords,
    Commission,
    viewInfo,
    financialInfo,
  },
  data() {
    return {
      orderNumber: "",
      markUpdate: "",
      orderStatus: "",
      isNew: false,
      golbalPermissions: [],
      orderInfo:{},

    };
  },
  created() {
    this.orderNumber = sessionStorage.getItem("orderNumber");
    this.findProductUrl(this.orderNumber);
    this.golbalPermissions = localStorage.getItem("permissions").split(",");
    this.getOrderInfo();

  },
  computed: {
    //财务信息按钮显示
    showBtn: function() {
      return checkPermiss("business:updateFinancial:ryd", this.golbalPermissions);
    },
    //财务信息
    showFinancialInfo: function() {
      return checkPermiss("business:upForm:financial:ryd", this.golbalPermissions);
    }
  },
  methods: {
    //获取订单信息
    getOrderInfo(){
      getFindOrderMessage(this.orderNumber).then(res=>{
        this.orderInfo=res.data;
      })
    },
    //根据订单查询订单状态
    findProductUrl(orderNumber) {
      getProductUrl({
        orderNumber: orderNumber,
      }).then((res) => {
        this.orderStatus = res.data.orderStatus;
        this.markUpdate = res.data.markUpdate;
      });
    },
  },
};
</script>

<style scoped type="less">
.text {
  font-size: 20px;
  font-weight: bold;
  text-align: left;
  margin-top: 20px;
  text-indent: 2em;
}
.state {
  font-size: 22px;
  font-weight: bold;
  float: right;
  margin-top: -20px;
  margin-right: 1%;
}
</style>
